<?php
error_reporting(E_ALL & ~E_NOTICE);
@session_start();
include('../function/config.php');
include('../function/function.php');
include('../function/thaidate.php');
include("../connect/connect.php");
/*
	if(!isset($_SESSION['user_username']) || !isset($_SESSION['user_name']) || !isset($_SESSION['user_surname']) || !isset($_SESSION['position_id'])){
    echo "<script>window.location = '../index.php';</script>";
    exit();
	}

	if(isset($_SESSION['position_id'])){
		if($_SESSION['position_id']!='2') {
		echo "<script>window.location = '../index.php';</script>";
   		exit();
		}
	}
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $config['title'];?></title>
<link rel="shortcut icon" href="../image/Letter-T.ico" />
<link rel="stylesheet" href="../jquery/css/validationEngine.jquery.css" type="text/css"/>
<script type="text/javascript" src="../jquery/js/jquery-1.5.1.js" ></script>
<script type="text/javascript" src="../jquery/js/jquery-1.6.min.js" ></script>
<script src="../jquery/js/languages/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
<script src="../jquery/js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
<link type="text/css" href="../jquery/css/redmond/jquery-ui-1.8.14.custom.css" rel="stylesheet" />	
<script type="text/javascript" src="../jquery/js/jquery-ui-1.8.14.custom.min.js"></script>
<script type="text/javascript" src="../jquery/js/jquery.ui.datepicker-th.js"></script>
<script type="text/javascript" src="../function/func.js"></script>
<script src="../jquery/js/jquery.clock.js" type="text/javascript"></script>
<LINK REL=StyleSheet HREF="../stylesheet/stylesheetfont.css" TYPE="text/css">
<script type="text/javascript">
$(document).ready(function(){	
	$( "input:submit, input:button").button({
		disabled: false,
	});

	$('.jclock').jclock();
	
	$('.list tr:odd').addClass('alt');
});


var HttPRequest = false;

function doCallAjax(CheckIn,CheckOut) {
	  HttPRequest = false;
	  if (window.XMLHttpRequest) { // Mozilla, Safari,...
		 HttPRequest = new XMLHttpRequest();
		 if (HttPRequest.overrideMimeType) {
			HttPRequest.overrideMimeType('text/html');
		 }
	  } else if (window.ActiveXObject) { // IE
		 try {
			HttPRequest = new ActiveXObject("Msxml2.XMLHTTP");
		 } catch (e) {
			try {
			   HttPRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		 }
	  } 
	  
	  if (!HttPRequest) {
		 alert('Cannot create XMLHTTP instance');
		 return false;
	  }

		var url = 'checkroom_show.php';
		var pmeters = 'CheckIn='+CheckIn + '&CheckOut='+CheckOut;
		HttPRequest.open('POST',url,true);

		HttPRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		HttPRequest.setRequestHeader("Content-length", pmeters.length);
		HttPRequest.setRequestHeader("Connection", "close");
		HttPRequest.send(pmeters);
		
		
		HttPRequest.onreadystatechange = function()
		{

			 if(HttPRequest.readyState == 3)  // Loading Request
			  {
			   document.getElementById("mySpan").innerHTML = "กรุณารอสักครู่...";
			  }

			 if(HttPRequest.readyState == 4) // Return Request
			  {
			   document.getElementById("mySpan").innerHTML = HttPRequest.responseText;
			  }
			
		}

}
</script>
</head>

<!-- แสดงเมนู -->
<div id="header" style="background: url('../image/<?php $wk = date("w"); echo BgHead($wk);?>') repeat-x;">
<div id="nMenu">
<ul id="nTopMenu">
<li class="nSelect<?php echo active_menu("/resort/font/index.php")?>"><a href="index.php">หน้าแรก</a></li>
<li class="nSelect<?php echo active_menu("/resort/font/checkroom.php").active_menu("/resort/font/roomselect.php");?>"><a href="checkroom.php">เช็คสถานะห้องพัก</a></li>
<li class="nSelect<?php echo active_menu("/resort/font/checkin.php")?>"><a href="checkin.php">Check In</a></li>
<li class="nSelect<?php echo active_menu("/resort/font/checkout.php")?>"><a href="checkout.php">Check Out</a></li>
<li class="nSelect<?php echo active_menu("/resort/font/deposit.php")?>"><a href="deposit.php">รับเงินมัดจำ</a></li>
<li class="nSelect<?php echo active_menu("/resort/font/room_edit.php")?>"><a href="room_edit.php">แก้ไขการจอง</a></li>
<li class="nSelect<?php echo active_menu("/resort/font/room_cancle.php")?>"><a href="room_cancle.php">ยกเลิกการจอง</a></li>
</ul>
</div>
<div class="div1" style="color:<?php echo HeadColor($wk); ?>;"><?php echo $config['header'];?><div class="div1-1"><?php echo date("d M Y ");?><span class="jclock"></span></div></div>
<div class="div2"><img src="../image/lock.png" alt="" style="position: relative; top: 3px;" /><strong>&nbsp;คุณเข้าระบบในชื่อ <?php echo $_SESSION["user_name"]." ".$_SESSION["user_surname"]; ?></strong><br />ตำแหน่ง <?php if($_SESSION["position_id"]=='1'){echo "พนักงาน";} if($_SESSION["position_id"]=='2'){echo "ผู้จัดการ";} ?></div>
</div>
<div id="content">

